<!DOCTYPE html>
<html>
<head>
  <script src="../../../js-test-resources/js-test.js"></script>
  <script>
    function runTest() {
      description('Tests that loading a cross-origin frame with a URL that contains an anchor fragment does not scroll this frame.');
      description('This prevents a cross-origin information leak sometimes know as framesniffing.');
      // Check scroll position in a timeout to make sure that the anchor has not been scrolled to.
      setTimeout(function() {
          shouldBeTrue('document.documentElement.scrollTop == 0');
          shouldBeTrue('document.documentElement.scrollLeft == 0');
          finishJSTest();          
      }, 0);
    }
    var jsTestIsAsync = true;
  </script>  
</head>
<body>
<!-- large cross-origin grandchild frame -->
<iframe height="8000" width="8000" src="http://localhost:8000/navigation/resources/grandchild-with-anchor.html#anchor1" name="grandchild" onload="runTest()">
</iframe>
</body>
</html>
